package com.beyond.quartz;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.beyond.dao.DataQueryDao;
import com.beyond.util.DataVerifyUtil;
import com.beyond.util.FileUtil;

public class JobSechdualerForH {

	static Logger logger = LoggerFactory.getLogger(JobSechdualerForH.class);
	
	public void execute()
	{
		 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		 long startTime = System.currentTimeMillis();
		 System.out.println("当前时间:"+sdf.format(new Date()));  
		 DataQueryDao queryDataDao = new DataQueryDao();
		 String tbs = "F_PS_GDS01_GPRS_15M,F_PS_GDS01_GPRS_CAUSE_15M,F_PS_GDS01_2G_CELL_15M,F_PS_GDS01_3G_SAC_15M,F_PS_GDS01_2G_CELL_CAUSE_15M,F_PS_GDS01_3G_SAC_CAUSE_15M,F_PS_GDS01_2G_GPRS_CAUSE_15M,F_PS_GDS01_3G_GPRS_CAUSE_15M,F_PS_GDS01_2G_TERMINAL_15M,F_PS_GDS01_3G_TERMINAL_15M,F_PS_GDS01_2G_USER_15M,F_PS_GDS01_3G_USER_15M,F_PS_GDS02_SERV_15M,F_PS_GDS02_2G_CELL_15M,F_PS_GDS02_3G_SAC_15M,F_PS_GDS02_2G_TERMINAL_H,F_PS_GDS02_3G_TERMINAL_H,F_PS_GDS02_SERV_TERMINAL_H,F_PS_GDS02_SERV_USER_H,F_PS_GDS02_2G_APN_USER_H,F_PS_GDS02_3G_APN_USER_H,F_PS_GDS03_GPRS_15M,F_PS_GDS03_GPRS_CAUSE_15M,F_PS_GDS03_2G_CELL_15M,F_PS_GDS03_3G_SAC_15M,F_PS_GDS03_2G_CELL_CAUSE_15M,F_PS_GDS03_3G_SAC_CAUSE_15M,F_PS_GDS03_2G_CELL_TERM_15M,F_PS_GDS03_3G_SAC_TERM_15M,F_PS_GDS03_2G_TERMINAL_15M,F_PS_GDS03_3G_TERMINAL_15M,F_PS_GDS03_TERMINAL_CAUSE_15M,F_PS_GDS03_TERMINAL_HOST_H,F_PS_GDS03_SP_CAUSE_15M,F_PS_GDS03_SP_OPERATOR_H,F_PS_GDS03_SP_H,F_PS_GDS03_2G_CELL_SP_H,F_PS_GDS03_3G_SAC_SP_H,F_PS_GDS03_SP_HOST_OPT_H,F_PS_GDS03_2G_USER_H,F_PS_GDS03_3G_USER_H,F_PS_GDS03_USER_SP_H,F_PS_GDS04_GPRS_15M,F_PS_GDS04_GPRS_CAUSE_15M,F_PS_GDS04_2G_CELL_15M,F_PS_GDS04_3G_SAC_15M,F_PS_GDS04_2G_CELL_CAUSE_15M,F_PS_GDS04_3G_SAC_CAUSE_15M,F_PS_GDS04_2G_TERMINAL_15M,F_PS_GDS04_3G_TERMINAL_15M,F_PS_GDS05_GPRS_15M,F_PS_GDS05_GPRS_CAUSE_15M,F_PS_GDS05_2G_CELL_15M,F_PS_GDS05_3G_SAC_15M,F_PS_GDS05_2G_CELL_CAUSE_15M,F_PS_GDS05_3G_SAC_CAUSE_15M,F_PS_GDS05_2G_TERMINAL_15M,F_PS_GDS05_3G_TERMINAL_15M,F_PS_GDS06_GPRS_15M,F_PS_GDS06_GPRS_CAUSE_15M";
		 System.out.println("===================Start Execute Day Insert into temp_data_record=====================");
//		 String[] strs = {"15m","H","D"};
		 String[] strs = {"H"};
		for (String tag : strs) {
//				FileUtil.createFile("C:\\sql\\"+tag+"_total.sql", createAllSql(getTagTable(tbs,tag),dao));
			 DataVerifyUtil.createAllSql(DataVerifyUtil.getTagTable(tbs,tag),queryDataDao);
		}
		 System.out.println("当前时间:"+sdf.format(new Date())); 
		 System.out.println("共执行了："+(System.currentTimeMillis()-startTime)+" 毫秒");
		 System.out.println("===================End Execute Sechdual.=====================");
	}
}
